home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_plant.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  116 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_Plant.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message        activated
  14. message        callback
  15.  
  16. cog            talkCog                    local
  17.  
  18. keyframe    get=in_reach_bulb.key    local
  19.  
  20. model        budHand=hand_in_bud.3do    local
  21.  
  22. sound        foundSnd=SS07J02.wav    local
  23. sound        clueSnd=SS07J08.wav        local
  24.  
  25. thing        player                    local
  26. thing        item=-1                    local
  27.  
  28. int            bin=105                    local
  29. int            swapRef                    local
  30. int            bSpoken=0                local
  31.  
  32. end
  33.  
  34. # ===================================================================
  35.  
  36. code
  37.  
  38. activated:
  39.  
  40.     StartCutscene(0);
  41.  
  42.     player = GetSourceRef();
  43.     item = GetSenderRef();
  44.  
  45.     SetActorFlags(player, 0x200000);
  46.     StopThing(player);
  47.  
  48.     talkCog = GetCogByIndex(0);
  49.     SendMessage(talkCog, 27);
  50.  
  51.     # Wait a bit before starting animation
  52.     Sleep(0.33);
  53.     if (GetInv(player, bin) < GetInvMax(player, bin))
  54.     {
  55.         CaptureThing(player);
  56.         PlayKey(player, get, 5, 0x12, 0); 
  57.     }
  58.     else
  59.     {
  60.         ClearActorFlags(player, 0x200000);
  61.         EndCutscene();
  62.         return;
  63.     }
  64.  
  65.     SetExtCamOffset('0.15 -0.05 0.04');
  66.     SetExtCamLookOffset('0.0 0.02 0.0');
  67.  
  68.     return;
  69.  
  70. # -------------------------------------------------------------------
  71.  
  72. callback:
  73.  
  74.     if (GetParam(1) == 21)
  75.     {
  76.         swapRef = SetThingMesh(player, 15, budHand, 0);
  77.  
  78.         if (item != -1)
  79.         {
  80.             DestroyThing(item);
  81.             item = -1;
  82.         }
  83.     }
  84.     else
  85.     {
  86.         ReleaseThing(player);
  87.         RestoreThingMesh(player, swapRef);
  88.     
  89.         ChangeInv(player, bin, 1.0);
  90.         SetInvAvailable(player, bin, 1);
  91.         JonesInvItemChanged(bin);
  92.     
  93.         RestoreExtCam();
  94.     
  95.         Sleep(1.0);
  96.  
  97.         if (!bSpoken)
  98.         {
  99.             bSpoken = 1;
  100.             Sleep(0.1);
  101.             PlayVoice(player, foundSnd, 1.0, 1);
  102.             PlayVoice(player, clueSnd, 1.0, 0);
  103.         }
  104.         else
  105.         {
  106.             PlayVoice(player, foundSnd, 1.0, 0);
  107.         }
  108.  
  109.         ClearActorFlags(player, 0x200000);
  110.         EndCutscene();
  111.     }
  112.  
  113.     return;
  114.  
  115. end
  116.